package com.hgyc.mom.data.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hgyc.mom.data.mapper.GoviewProjectDataMapper;
import com.hgyc.mom.data.entity.GoviewProjectData;
import com.hgyc.mom.data.service.GoviewProjectDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import com.hgyc.mom.common.exception.BizException;
import org.springframework.util.CollectionUtils;

/**
 * 大屏项目数据Service业务层实现
 *
 * @author fwj
 * @since 2025-08-08
 */
@Slf4j
@Service
public class GoviewProjectDataServiceImpl extends ServiceImpl<GoviewProjectDataMapper, GoviewProjectData> implements GoviewProjectDataService {

    @Override
    public void saveData(GoviewProjectData goviewProjectData) {
        // TODO 其他逻辑
        save(goviewProjectData);
    }

    @Override
    public void updateData(GoviewProjectData goviewProjectData) {
        // TODO 其他逻辑
        updateById(goviewProjectData);
    }

    @Override
    public void removeData(List<Long> ids) {
        // TODO 其他逻辑
        removeByIds(ids);
    }

    @Override
    public GoviewProjectData getByProjectId(Long projectId) {
        LambdaQueryWrapper<GoviewProjectData> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(GoviewProjectData::getProjectId, projectId);

        return getOne(queryWrapper, false);
    }

    @Override
    public void removeByProjectIds(List<Long> ids) {
        LambdaQueryWrapper<GoviewProjectData> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(GoviewProjectData::getProjectId, ids);
        remove(queryWrapper);
    }
}
